<?php
/**
 * Created by PhpStorm.
 * User: 86188
 * Date: 2021/12/1
 * Time: 10:43
 */

namespace vendor\core;


class person
{
    //     2.4.2 类属性和方法，访问控制
    protected $name;
    protected $age;
    protected $gender;


    public function eat()
    {
        echo 'eat';
        echo '<br>';
    }

    //     2.4.3 构造函数和析构函数
    public function __construct($name,$age,$gender)
    {
        $this->name = $name;
        $this->age = $age;
        $this->gender = $gender;
        echo 'person 对象创建';
        echo '<br/>';
    }

    public function __destruct()
    {
        // TODO: Implement __destruct() method.
        echo 'person 对象清除';
        echo '<br>';
    }
}